In image encoding and decoding technology, with respect to the process of image encoding, an image is generally partitioned into coding blocks and then subject to the encoding process. The partitioned image blocks is then transformed by an orthogonal transform to obtain corresponding block transform coefficients, and the block transform coefficients are then quantized and clipped to integers and are then subject to entropy coding to finally obtain a encoded bit stream corresponding to the image, thereby realizing the encoding process of the image.
In the architecture of video compression/coding, data feed to quantization computation during intra coding is the values of image block transform coefficients, while data feed to quantization computation during inter-coding is values of residual coefficients. Since content information of an image is completely stored in the transform coefficients or residual coefficients, quality control of compressed image may be realized by controlling quantization process in image coding process.
Images described in the present invention include static images, moving images, residual image of two adjacent images of moving images, target image obtained by performing an operation on any number of moving images, etc.
In encoding, quantization of transform coefficients is generally realized by a quantization matrix, e.g. by the following equation:
                              Q          ⁡                      (                          i              ,              j                        )                          =                  [                                    Coe              ⁡                              (                                  i                  ,                  j                                )                                                    QM              ⁡                              (                                  i                  ,                  j                                )                                              ]                                    (        1        )            where, Coe(i, j) is a value of a pixel at location (i, j) after transform computation on image blocks, which is referred to as transform coefficient, QM(i, j) is a quantization matrix, Q(i, j) is a value of transform coefficient after quantization and truncation, which is referred as quantized coefficient value, and [•] is the truncation calculation.
Since the details of images of different contents represent different image frequencies and human eyes have different subjective feeling for different parts of an image, different quantization methods that match features of human eyes should be used for images of different contents.
At present, in image/video coding standards such as Joint Photographic Experts Group (JPEG), MPEG-1 (MPEG, Motion Picture Experts Group), MPEG-2 and MPEG-4, fixed quantization matrixes are used for quantization computation in image coding, wherein in JPEG image coding standard, the quantization matrix is stored in the image header, while in MPEG-1, MPEG-2 and MPEG-4, the quantization matrixes are stored in the sequence header. Therefore, for a sequence of images, the MPEG standard allows only one quantization matrix in sequence bit stream, that is, the whole sequence uses a same fixed quantization matrix in image quantization.
While an image is observed from human eyes, the quality evaluation of this image is made according to the subjective quality of the image perceived by human eyes, a better subjective image quality is obtained while a suitable quantization method is used for image quantization to match vision features of human eyes, i.e. for an image sequence, better subjective image quality is obtained only if appropriate quantization matrixes are selected in quantization.
However, the contents of images in a sequence are rarely identical, instead, they may vary greatly, that is, details of images in a same sequence are different from each other, and if a same quantization matrix is used in quantization for the entire sequence, the compressed images cannot achieve optimal subjective quality.